<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Register Src="~/Views/Menu/MainMenu.ascx" TagName="MainMenu" TagPrefix="mmuc" %>
<%@ Register Src="~/Views/Shared/LogOnUserControl.ascx" TagName="LogOnUserControl" TagPrefix="louc" %>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <louc:LogOnUserControl ID="LogOnUserControl1" runat="server" />
    <!-- BEGIN: MainMenu -->
    <mmuc:MainMenu ID="MainMenu1" runat="server" />
    <!-- END: MainMenu -->
    <br />
    <br />
    <!-- TinyMCE -->

    <script type="text/javascript" src='<%= Url.Content("~/Scripts/TinyMCE/tiny_mce.js") %>'></script>

    <script type="text/javascript">
        tinyMCE.init({
            mode: "textareas",
            theme: "simple"
        });
       
    </script>

    <!-- /TinyMCE -->

    <script type="text/javascript" language="javascript">
        $(document).ready(function() {
            $('#submit').click(function() {
                var content = tinyMCE.activeEditor.getContent(); // get the content
                $('#Comment').val(content); // put it in the textarea
            });

            $("#UpdateHomeOwnerInforForm").validate({
                rules: {
                    FullName: {
                        required: true
                    },
                    Email: {
                        required: true,
                        email: true
                    },
                    Address: {
                        required: true
                    },
                    Comment: {
                        required: true
                    }
                },
                messages: {
                    FullName: {
                        required: "Full Name cannot be blank"
                    },
                    Email: {
                        required: "Email cannot be blank",
                        email: "Email must be valid"
                    },
                    Address: {
                        required: "Address cannot be blank"
                    },
                    Comment: {
                        required: "Comment cannot be blank"
                    }
                }
            });
        });
    </script>

    <%= Html.ValidationSummary() %>
    <% using (Html.BeginForm("UpdateHomeOwnerInfor", "Home", FormMethod.Post, new { id = "UpdateHomeOwnerInforForm", enctype = "multipart/form-data" }))
       { %>
    <fieldset>
        <legend>Update Home Owner Information</legend>
        <br />
        <table cellpadding="3" cellspacing="1" border="0">
            <tbody>
                <tr>
                    <td>
                        <label for="FullName">
                            Full Name:</label>
                    </td>
                    <td>
                        <%= Html.TextBox("FullName")%>
                        <%= Html.ValidationMessage("FullName")%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="Email">
                            Email:</label>
                    </td>
                    <td>
                        <%= Html.TextBox("Email")%>
                        <%= Html.ValidationMessage("Email")%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="Lot Number:">
                            Lot Number:</label>
                    </td>
                    <td>
                        <%= Html.TextBox("LotNumber")%>
                        <%= Html.ValidationMessage("LotNumber")%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="Address">
                            Address:</label>
                    </td>
                    <td>
                        <%= Html.TextBox("Address")%>
                        <%= Html.ValidationMessage("Address")%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="Phone">
                            Phone:</label>
                    </td>
                    <td>
                        <%= Html.TextBox("Phone")%>
                        <%= Html.ValidationMessage("Phone")%>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <label for="Comment">
                            Comments:</label>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
                        <textarea id="Comment" name="Comment" rows="15" cols="100" style="width: 100%">
	        </textarea>
                        <%= Html.ValidationMessage("Comment", "*")%>
                    </td>
                </tr>
            </tbody>
        </table>
        <p>
            <input type="submit" name="submit" id="submit" value="Update Home Owner Infor" />
            <input type="reset" value="Reset" />
        </p>
    </fieldset>
    <% } %>
</asp:Content>
